﻿<?xml version="1.0" encoding="utf-8" ?>
<AdoNetDataAccess connection="$SyrinxDBConnection$" formatter="bizobjlist of TreeNode">
	<Sql>
		SELECT  
			t.id,t.parentId,t.parentHostId,t.objectId,
			c.rootId, c.keyName,c.name,c.treeName,c.depth,
			c.authorId AS counts_authorId,
			c.totalL1 AS counts_totalL1, c.totalL2 AS counts_totalL2, c.totalL3 AS counts_totalL3, c.totalL4 AS counts_totalL4,
			c.totalViews AS counts_totalViews, c.lastViewed AS counts_lastViewed,
			c.lastChildUpdated AS counts_lastChildUpdated, c.lastchildUpdatedByUserId AS counts_lastChildUpdatedByUserId,
			c.dateCreated AS counts_dateCreated, c.dateUpdated AS counts_dateUpdated
			
		FROM ObjectTreeNodes as t
		LEFT OUTER JOIN ObjectTreeCounts as c on c.objectId = t.objectId
		WHERE parentHostId=@parentId AND id &lt;&gt; @parentId
		ORDER BY c.keyName;
	</Sql>
	<Param name="parentId" type="UniqueIdentifier"/>
</AdoNetDataAccess>